//
//  TestSocketViewController.m
//  Builder
//
//  Created by JCK on 2017/12/16.
//  Copyright © 2017年 JCK. All rights reserved.
//
/*
 /// <summary>
 /// 服务器收到心跳协议号
 /// </summary>
 Heart = 1000,
 /// <summary>
 /// 服务器收到经纬度
 /// </summary>
 AcceptLocation = 1001,
 /// <summary>
 /// 服务器收到用工申请
 AcceptReplayChe = 1002,
 /// <summary>
 /// 服务器“发送”用工申请给工人
 SendReplayChe = 1003,
 /// <summary>
 /// 服务器收到取消订单通知
 /// </summary>
 AcceptCancelOrder = 1004,
 /// <summary>
 /// 服务器收到抢单成功通知
 /// </summary>
 AcceptOrderSuccess = 1005,
 /// <summary>
 /// 服务器“发送”订单状态变更通知
 /// </summary>
 SendOrderStatus = 1006,
 /// <summary>
 /// 服务器接收订单状态通知
 /// </summary>
 AccptOrderStatus = 1007,
 /// <summary>
 /// 服务器发送取消订单给工人
 /// </summary>
 SendCancelOrder = 1008,
 
 /// <summary>
 /// 雇主方付款成功指令
 /// </summary>
 PaySuccess=1013,
 /// <summary>
 /// 雇主方付款成功回传指令，更新工人钱包
 /// </summary>
 PayReturn=1014,
 */
#import "TestSocketViewController.h"
#import "BaseSocketManager.h"
@interface TestSocketViewController ()
{
    BaseSocketManager *socketManager;
}
@property (weak, nonatomic) IBOutlet UILabel *contextLab;

@end

@implementation TestSocketViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    socketManager = [[BaseSocketManager shareInstance] initWith:0];
}
- (IBAction)qiangdan:(id)sender {
    [socketManager sendDataToSocket:@"test001" PNo:@"1005" successBlock:^(id responseBody) {
        NSLog(@"抢单回复: %@",responseBody);
        _contextLab.text = responseBody;
    }];
}
- (IBAction)xintiao:(id)sender {
    [socketManager sendDataToSocket:@"" PNo:@"1000" successBlock:^(id responseBody) {
        NSLog(@"心跳回复: %@",responseBody);
        _contextLab.text = responseBody;
    }];

}
- (IBAction)quxiao:(id)sender {
    [socketManager sendDataToSocket:@"test001" PNo:@"1004" successBlock:^(id responseBody) {
        NSLog(@"取消回复: %@",responseBody);
        _contextLab.text = responseBody;
    }];

}


- (IBAction)fukuan:(id)sender {
    [socketManager sendDataToSocket:@"test001" PNo:@"1013" successBlock:^(id responseBody) {
        NSLog(@"付款回复: %@",responseBody);
        _contextLab.text = responseBody;
    }];
}
- (IBAction)fabu:(id)sender {
    [socketManager sendDataToSocket:@"test001" PNo:@"1003" successBlock:^(id responseBody) {
        NSLog(@"发布回复: %@",responseBody);
        _contextLab.text = responseBody;
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
